package com.guet.niit.Admin.service;

import com.guet.niit.Admin.dao.AgentDaolmpl;
import com.guet.niit.Admin.pojo.Agent;

import java.util.List;
import java.util.Scanner;

public class AgentService {


    //代理商添加
    public void agentAdd(){
//        Scanner scanner = new Scanner(System.in);
//        System.out.println("请输入代理商id:");
//        Long id = scanner.nextLong();
//        System.out.println("代理商名称:");
//        String username = scanner.next();
//        System.out.println("请输入密码:");
////        Long password =  scanner.nextLong();
//        String password = scanner.next();
//
//        //AgentService agentService = new AgentService();
//        Agent agent = new Agent(id,username,password);
//        agent.setId(id);
//        agent.setUsername(username);
//        agent.setPassword(password);
//
//        AgentDaolmpl agentDaolmpl = new AgentDaolmpl();
//        agentDaolmpl.agentAdd(agent);

    }

    //代理商删除
    public void agentDelete(){
        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入你需要删除的代理商id:");
        Long id = scanner.nextLong();

        AgentDaolmpl agentDaolmpl = new AgentDaolmpl();
        agentDaolmpl.agentDelete(id);
    }

    //代理商更改
    public void agentModify(){
//        Scanner ms = new Scanner(System.in);
//        System.out.println("请输入你需要更改的代理商id:");
//        Long id = ms.nextLong();
//
//        System.out.println("请输入代理商名称:");
//        String username = ms.next();
//
//        System.out.println("请输入密码:");
////        Long password = ms.nextLong();
//        String password = ms.next();
//
//        Agent agent = new Agent(id,username,password);
//
//        agent.setId(id);
//        agent.setUsername(username);
//        agent.setPassword(password);
//
//        AgentDaolmpl agentDaolmpl = new AgentDaolmpl();
//        agentDaolmpl.agentModify(agent);
//
//        System.out.println("代理商修改完成");

    }

    //代理商查询
//    public void agentInquire(){
    public List<Agent> agentInquire(){
        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入你需要查询的ID:");
        Long id = scanner.nextLong();

        AgentDaolmpl agentDaolmpl = new AgentDaolmpl();
        List<Agent> agents = agentDaolmpl.agentInquire();
//        System.out.println(agentArrayList);
        return agents;
    }
}
